package net.versiforma.libraryreminder.emails;

import java.text.MessageFormat;
import java.util.Properties;

public class EmailMessage {
	
	protected String addressee;
	protected String subject;
	protected String messageBody;
	
	protected Properties prop;
	protected String serviceName;
	protected String serviceUrl;
	protected String serviceMotto;

	protected String lineBreak = System.getProperty("line.separator");
	
	protected String mailSignature;

	
	public EmailMessage(Properties properties) {
		prop = properties;
		serviceName = prop.getProperty("serviceName");
		serviceUrl = prop.getProperty("serviceUrl");
		serviceMotto = prop.getProperty("serviceMotto");
		mailSignature = MessageFormat.format(prop.getProperty("mailSignatureSkeleton"),
				serviceName,
				serviceUrl,
				serviceMotto
		);
		mailSignature = mailSignature.replaceAll("<br\\s*\\/?>", lineBreak);
	}

	public String getAddressee() {
		return addressee;
	}

	public String getSubject() {
		return subject;
	}

	public String getMessageBody() {
		return messageBody;
	}

	
}
